/*
 * Copyright 2021 <copyright holder> <email>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef CAMERA_H
#define CAMERA_H

#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>

/**
 * @todo write docs
 */

struct posture
{
    float pos[3];
    float post[3][3];
};

class camera
{
public:
    camera(float cf,float ca,cv::Size size,float *dist,float *pos,float *post);
    cv::Mat getinstrinsic();
    cv::Mat getdistcoefficient();
    cv::Mat getpos();
    cv::Mat getpost();
    bool updatepost(const posture &newposture);
    bool updatecamerapath();
    cv::Mat updatepost();
    cv::Mat getw2c();
    cv::Point2f project(const cv::Point3f &pworld);
    cv::Point3f invproject();
    std::vector<posture> getcamerapath();//不够再new；
    
private:
    float f;
    float alph;
    cv::Size imagesize;
    cv::Size planesize;
    float distor[5];
    posture beginposture;
    posture currentposture;
    std::vector<posture> camerapath; 
};

#endif // CAMERA_H
